<template>
  <div class="my-header" :style="{ color, backgroundColor }">
    {{ title }} - {{ dogname }}
  </div>
</template>

<script>
export default {
  // props: ["title", "color", "backgroundColor"],
  props: {
    title: String,
    color: {
      type: String,
      default: "#000",
    },
    backgroundColor: {
      default: "red",
    },
  },
  data() {
    return {
      dogname: "小白",
    };
  },
  methods: {
    test() {
      console.log(this.title);
      console.log(this.dogname);
    },
  },
};
</script>

<style lang="less" scoped>
.my-header {
  height: 45px;
  line-height: 45px;
  text-align: center;
  background-color: #1d7bff;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
}
</style>